Skip to content

Conversation

@t-bast
Copy link
Member

@t-bast t-bast commented Oct 10, 2024

If the latest splice transaction doesn't confirm, we allow exchanging tx_init_rbf and tx_ack_rbf to create another splice transaction to replace it. We use the same funding contribution as the previous splice.

When 0-conf isn't used, we reject splice_init while the previous splice transaction hasn't confirmed. Our peer should either use RBF instead of creating a new splice, or they should wait for our node to receive the block that confirmed the previous transaction. This protects against chains of unconfirmed transactions.

When using 0-conf, we reject tx_init_rbf and allow creating chains of unconfirmed splice transactions: using RBF with 0-conf can lead to one side stealing funds, which is why we prevent it.

If our peer was buying liquidity but tries to cancel the purchase with an RBF attempt, we reject it: this prevents edge cases where the seller may end up adding liquidity to the channel without being paid in return.

Fixes #2781

If the latest splice transaction doesn't confirm, we allow exchanging
`tx_init_rbf` and `tx_ack_rbf` to create another splice transaction to
replace it. We use the same funding contribution as the previous splice.

When 0-conf isn't used, we reject `splice_init` while the previous
splice transaction hasn't confirmed. Our peer should either use RBF
instead of creating a new splice, or they should wait for our node
to receive the block that confirmed the previous transaction. This
protects against chains of unconfirmed transactions.

When using 0-conf, we reject `tx_init_rbf` and allow creating chains of
unconfirmed splice transactions: using RBF with 0-conf can lead to one
side stealing funds, which is why we prevent it.

If our peer was buying liquidity but tries to cancel the purchase with
an RBF attempt, we reject it: this prevents edge cases where the seller
may end up adding liquidity to the channel without being paid in return.
Copy link
Contributor

@remyers remyers left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good so far, I only have a few comments/questions.

t-bast and others added 2 commits October 15, 2024 08:25
As reported in the PR comments.
This adds to existing tests a simple check that alternate funding txs that won't
confirm are rolled back so that their inputs will be unlocked.
Copy link
Contributor

@remyers remyers left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've gone over these changes now a few times and it all looks good!

@t-bast t-bast merged commit 13d4c9f into master Oct 18, 2024
1 check passed
@t-bast t-bast deleted the splice-rbf branch October 18, 2024 02:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add support for RBF for splice transactions

3 participants